const mongoose = require('mongoose')
const { Schema } = mongoose

const userSchema = new Schema({
  username: String,
  password: String,
  phone: String,
  code: String,
  nickname: String,
  avatarUrl: String,
  sex: String,
  birthday: String,
  scores: Number,
  token: String,
  cart: Array,
  addresses: Array,
  orders: Array,
  status: Number, // 0:禁用 1:激活 -1:删除或新用户还未注册
})

const UserModel = mongoose.model('User', userSchema)

module.exports = UserModel
